package com.jt.controller;

import com.jt.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.xml.ws.RequestWrapper;

@Controller//SpringMVCh专门扫描注解

public class HelloController {

    @RequestMapping("/hello")//映射路径
    @ResponseBody//返回JSON串 json本质字符串
    public String hello(){
        return "你好,mvc";
    }


    @RequestMapping("/hello111")//映射路径
    @ResponseBody//返回JSON串 json本质字符串
    public User getUser(){
        User user=new User();
        user.setId(100);
        user.setName("tom");
        return user;
    }


}
